package day05;

import java.util.Scanner;

public class Homework1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int sum=0;
        int times;
        int score=0;
        for(times =1;times<=10;times++)
        {
            int i = (int)(Math.random()*100+1);
            int j = (int)(Math.random()*100+1);
            System.out.println(i+ "+"+ j+ "=?");
            sum=i+j;
            int num =scanner.nextInt();
            if(num==sum){
                System.out.println("答对了！");
                score+=10;
            }
            else {
                System.out.println("答错了");
            }

        }
        System.out.println("总成绩为："+score);
        if(score<60)
        {
            System.out.println("不及格");
        }
    }
}
